<?php

namespace Medicina\KernelBundle\Entity;

use Doctrine\ORM\EntityRepository;

class RoleRepository extends EntityRepository {

    public function getRolUsuario() {

        $em = $this->getEntityManager();
        $consulta = $em->createQueryBuilder()
                ->select('r')
                ->from('\Medicina\KernelBundle\Entity\Role', 'r')
               
                ->where('r.name =:rol')

                ->setParameter('rol', "ROLE_USUARIO")
                ->getQuery();
         $role = $consulta->getResult();
         return $role;
       
    }

}

?>
